home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MIDICraft's MIDINET CD-ROM
/
MIDICraft's MIDINET CD-ROM.iso
/
DOSUTILS
/
MIDITRIM.DOC
< prev
next >
Wrap
Text File
|
1997-03-03
|
7KB
|
200 lines
******************************
MIDITRIM v1.1
midi binaries to general midi
by Guenter Nagler
1996
(gnagler@ihm.tu-graz.ac.at)
******************************
[0] FEATURES
+ reads a binary midi file
+ writes a binary midi file
+ removes delays at beginning and end of midi song
+ reduces time between events that are before first note and after
last relevant note event
+ can trim pauses at start, at end or at both sides
[1] BACKGROUND
Some midi files have long starting time and that only because of delays
entered by author or its sequencer. Also at end of midifiles sometimes
are large delays where no notes are played until the midi song is finished.
This is no problem if using an interactive midi player where you can
manually skip a part of a midi or stop the song to start the next one in
playing list.
But if it is wanted that the song list plays without interaction it is
annoying if there are midi files in the list that contain a delay that
is not part of music.
This program reads a midi file (format 0 or 1) and searches the points
where music stars playing and music finishes. If there are mute delays at
start or at the end of the song the program produces a midi files that
doesn't contain these delays.
The program cannot remove delays that are inside the song, which could
be midi file errors or sequencing failure.
[2] FILES DESCRIPTION
MIDITRIM.EXE.........converter program for removing delays at start and end
MIDITRIM.DOC.........this file, showing usage of MIDITRIM.EXE
MIDIIO.HPP..........header file for a c++ midi parser
MIDIIO.CPP..........source code for a c++ midi parser
MIDITRIM.CPP.........c++ source code for modifying midi files
MIDITRIM.MAK.........make file for project
MIDITRIM.CFG.........compiler options for make
MIDITRIM.PRJ.........compiler project for Borland (tm) c++ compilers
only MIDITRIM.EXE is required to run program
[3] COPYRIGHT
MIDITRIM (c) 1996 was created by Guenter Nagler.
MIDITRIM is free and may be used as you wish with this one exception:
You may NOT charge any fee or derive any profit for distribution
of MIDITRIM. Thus, you may NOT sell or bundle MIDITRIM with any
product in a retail environment (shareware disk distribution, CD-ROM,
etc.) without permission of the author.
You may give MIDITRIM to your friends, upload it to a BBS, or ftp it to
another internet site, as long as you don't charge anything for it.
[4] DISCLAIMER
MIDITRIM was designed to handle only 100% compatible midi files.
Treat the program as an experiment and keep your originals until
you are sure that the conversion results satisfy your desire.
If you find a midi file that you think to be 100% compatible midi
that is not correctly converted, please send a sample file to
gnagler@ihm.tu-graz.ac.at .
Use MIDITRIM at your own risk. Anything you do with MIDITRIM is your
responsibility, and not the author's. Any damage caused to any person,
computer, software, hardware, company, or business by running MIDITRIM
is your responsibility, and the author will not be liable.
If you don't understand these terms, or are not sure of something, or
are afraid something bad might come of using MIDITRIM, don't use it!
You are here forewarned.
[5] INSTALLATION
[MSDOS]
Simply copy MIDITRIM.EXE in a directory that is in your path.
When you start the program without arguments
[UNIX]
compile sources with your C++ compiler (e.g. GNU Compiler g++):
g++ -o miditrim miditrim.cpp midiio.cpp
and run program
$ miditrim
C:\> MIDITRIM
you should get the usage text (see next section)
[6] USAGE
miditrim removes pauses at beginning and end of song
usage: miditrim [-start] [-end] [-both] file.mid [newfile.mid]
-start remove pauses before first note in song is played
-end remove pauses after last note in song has stopped
-both trim start and end of song (is default)
The parts in brackets [...] are optional.
When miditrim is started with only one parameter, the midi file will be
analysed. The results show if trimming at start or at end is possible.
Hidden option -version shows program version.
By default miditrim trims both sides (start and end) of the midi song.
If used with option -start or -end only the specified side will be considered
for trimming. Using -start and -end at same time has same effect as option
-both. Option -both is default if none of arguments -start and -end are
specified.
start: miditrim removes pauses from beginning of song till start of first note.
end: miditrim removes pauses from last stopped note till end of song.
Warning:
MIDITRIM will overwrite newfile.mid without warning!
Keep the original file until you don't need it anymore. The newfile.mid
cannot be converted back to the original file!
Warning:
Some Sysex commands require pauses to work properly. Usually these commands
are used before start of the song for initialization.
For such cases option -end should be used instead of default option -both
or -start, to leave the necessary pauses inside the midi file.
[8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
WWW: http://hgiicm.tu-graz.ac.at/Cpub
contains all my dos/unix midi programs
EMAIL: gnagler@ihm.tu-graz.ac.at
[9] USE
example: get the current program version
command> miditrim -version
miditrim v1.0 by Günter Nagler (Oct 05 1996)
example: get information about delays at beginning and end
command> miditrim file1.mid
first event: 0
last event: 80773
first note: 0
last note: 60480
end: 80773
pause 60480-80773 could be trimmed.
The values are midi units which are between 0 (start) and the value end.
first/last event are the range of units where any midi events occured.
first/last note are the range of units where notes are played.
There is no delay between start and first note (both 0).
There is a large delay between last note and end (60480-80773).
This delay could be worth to be trimmed.
Hint: miditrim will remove the pauses
start (0) till first note
and
last note till end
example: trim file1.mid into new file file2.mid
command> miditrim file1.mid file2.mid
output written to file2.mid
command> miditrim file2.mid
first event: 0
last event: 60480
first note: 0
last note: 60480
end: 60480
file1.mid is already trimmed.
command> miditrim -start file1.mid file2.mid
output written to file2.mid
Pauses at start of song (if available) are removed till first note starts
playing.
command> miditrim -end file1.mid file2.mid
output written to file2.mid
Pauses at end of song (if available) are removed after last note stopped
playing.
command> miditrim file2.mid
first event: 0
last event: 60480
first note: 0
last note: 60480
end: 60480
file1.mid is already trimmed.